package com.aprilTomCat.TestServlet;

import com.aprilTomCat.Servlet.HttpServetRequest;
import com.aprilTomCat.Servlet.HttpServetResponse;
import com.aprilTomCat.Servlet.HttpServlet;
import com.aprilTomCat.util.ResponseUtil;
import com.aprilTomCat.webServlet.WebServlet;

import java.io.IOException;

/**
 * @author April
 * 用户自定义Servlet：加入tomcat的包
 */

@WebServlet(urlMapping = "/my")
public class MyServlet extends HttpServlet {
    @Override
    public void doGet(HttpServetRequest request, HttpServetResponse response) throws IOException {
        response.getWriteNIO(ResponseUtil.getResponseHeader200("this is get Method"));
    }

    @Override
    public void doPost(HttpServetRequest request, HttpServetResponse response) throws IOException {
        response.getWrite(ResponseUtil.getResponseHeader200("this is post Method"));
    }
}
